<template>
	<view class="item" :style="{width:itemWidth+'rpx'}" v-for="item,index in selectedLst" :key="index">
		<view class="img">
			<image :src="item.goods_big_logo" mode="widthFix"></image>
		</view>
		<view class="content">
			<view class="name">{{item.name.length>maxSize?item.name.substr(0,maxSize)+"...":item.name}}</view>
			<view class="info">
				<text>{{item.price}}</text>
				<text class="tag">精选</text>
			</view>
		</view>
	</view>
</template>

<script setup>
 
	const prop = defineProps({
		"itemWidth": Number,
		"selectedLst": Array,
		"maxSize": Number})
</script>

<style>
	.item {
		border: 1px solid #ddd;
		background-color: #fff;
		padding: 15rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		border-radius: 10rpx;
		box-shadow: 3px 3px 3px #ccc;
		margin-top: 10rpx;
	}

	.item>.img {
		width: 95%;
		border: 1px solid #ddd;
	}

	.item>.img>image {
		width: 100%;
		height: 100%;
	}

	.item>.content {
		width: 95%;
		margin-top: 5rpx;
	}

	.item>.content>.name {
		color: #666;
		font-size: 25rpx;
		margin: 8rpx 0;
	}

	.item>.content>.info {
		display: flex;
		justify-content: space-between;
	}

	.item>.content>.info>text:nth-child(1) {
		color: #f33;
		font-size: 30rpx;

	}

	.item>.content .tag {
		background-color: #ff6700;
		padding: 5rpx 8rpx;
		color: #fff;
		font-size: 25rpx;
		border-radius: 6rpx;
	}
</style>